package pers.cz.logtail.balance;

import java.util.List;

/**
 * @program: JefLogTail
 * @description: 轮询负载均衡
 * @author: Cheng Zhi
 * @create: 2023-10-05 09:42
 **/
public class RoundLoadBalance implements LoadBalance {

    private int choose = -1;

    @Override
    public String balance(List<String> addressList) {
        choose++;
        choose = choose%addressList.size();
        return addressList.get(choose);
    }
}
